<%@ page language="java" pageEncoding="UTF-8"%>

<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean"
	prefix="bean"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html"
	prefix="html"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic"
	prefix="logic"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles"
	prefix="tiles"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html locale="true">
<head>
	<html:base />

	<title>cfgFinancieras.jsp</title>

	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script type="text/javascript">
		
		
		$(function() {
			$('select#menuCatalogos').selectmenu({style:'dropdown'});
			
			$( "#accordion" ).accordion({
				active: false,
				collapsible: true,
				autoHeight: false
			});

		});
	
		function guardarDatos() {
			document.forms[1].submit();
		}

		function limpiarDatos() {
			var txts = document.getElementsByName("props");
			for ( var i = 0; i < txts.length; i++) {
				txts[i].value = "";
			}
		}
	
		function nuevoRegistro() {
			document.forms[0].action = "/agvWeb/adm.do?method=cfgPerfiles";
			document.forms[0].submit();
		}
	
		function checkAll(check){
			$(check).parents('li:eq(0)').children('ul:eq(0)').find(':checkbox').attr('checked', check.checked);
		}
	</script>

</head>

<body>
	<html:form action="/admPerfil.do?method=insertarBd">
		<table width="100%" height="100%">
			<tr>
				<td width="30%">
					<table width="100%" height="100%" style="vertical-align: top;">
						<tr>
							<td align="center"
								style="vertical-align: top; padding-top: 30px;">
								<label>
									Alta de nuevo perfil de usuario
								</label>
							</td>
						</tr>
						<tr>
							<td height="100%" width="100%"
								style="vertical-align: top; padding-top: 20px;">
								<div style="vertical-align: top;">
									<table align="center" style="vertical-align: top;">
										<tr>
											<td colspan="2">
												<html:messages id="msg" message="true">
													<font style="color: red; font-size: 10px;">
														Error:&nbsp;<bean:write name="msg" /> </font>
												</html:messages>
											</td>
										</tr>
										<tr class="odd">
											<td align="right"
												style="height: 30px; font-family: sans-serif; font-size: 12px;">
												nombre del perfil
												<font style="color: red; font-size: 10px">*</font>
											</td>
											<td style="height: 30px; width: 200px;">
												<html:text styleId="props" property="nbPerfil" value=""
													styleClass="text ui-widget-content ui-corner-all" />
											</td>
										</tr>
										<tr class="odd">
											<td align="right"
												style="height: 30px; font-family: sans-serif; font-size: 12px;">
												estatus del perfil
												<font style="color: red; font-size: 10px">*</font>
											</td>
											<td style="height: 30px; width: 200px;">
												<logic:notEmpty name="menuSelect" scope="session">
													<html:select property="stPerfil" styleId="menuCatalogos">
														<logic:iterate id="arMenu" name="menuSelect"
															scope="session"
															type="com.agv.core.objectDomain.MenuSelect">
															<html:option style="width: 200px;"
																value="<%=arMenu
																							.getIdCampo()
																							.toString()%>"><%=arMenu
																							.getNbLeyenda()%></html:option>
														</logic:iterate>
													</html:select>
												</logic:notEmpty>
											</td>
										</tr>
									</table>
								</div>
							</td>
						</tr>
					</table>
				</td>
				<td width="70%">
					<table width="100%" height="100%" style="vertical-align: top;">
						<tr>
							<td style="vertical-align: top; padding-top: 30px;">
								<label>
									Asignaci&oacute;n de Facultades
								</label>
							</td>
						</tr>
						<tr>
							<td width="100%" height="100%">
								<table width="100%" height="100%">
									<tr>
										<td valign="top" style="padding-top: 20px">

											<div id="accordion">
												<logic:iterate id="modulo" name="modulosObj"
													type="com.agv.core.objectDomain.Modulo">
													<h3>
														<a style="cursor: pointer;"><bean:write name="modulo"
																property="nbModulo" /> </a>
													</h3>
													<div>
														<ul>
															<logic:iterate id="subModulo" name="modulo"
																type="com.agv.core.objectDomain.SubModulo"
																property="subModulos" indexId="indexSub">
																<li id="liga">
																	<input type="checkbox" name="checkall" id="checkall"
																		onclick="checkAll(this)">
																	<bean:write name="subModulo" property="nbSubModulo" />
																	<ul>
																		<logic:iterate id="funcion" name="subModulo"
																			type="com.agv.core.objectDomain.Funcion"
																			property="funciones" indexId="index">
																			<li style="list-style-type: none;">
																				<html:checkbox property="idFuncion"
																					styleId="checkbox"
																					value='<%=funcion.getIdFuncion().toString()%>' />
																				<bean:write name="funcion" property="nbFuncion" />
																			</li>
																		</logic:iterate>
																	</ul>
																</li>
															</logic:iterate>
														</ul>
													</div>
												</logic:iterate>
											</div>
										</td>
									</tr>

								</table>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</html:form>

</body>
</html:html>
